
import $router from "@/cfsheep/router";
import $platform from "@/cfsheep/platform";
import $helper from "@/cfsheep/helper"; 
import $store from "@/cfsheep/store";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import duration from "dayjs/plugin/duration";
import "dayjs/locale/zh-cn";

dayjs.locale("zh-cn");
dayjs.extend(relativeTime);
dayjs.extend(duration);

const cfsheep ={
  $store,
  $router,
  $platform,
  $helper, 
};

// 加载CfInit底层依赖
export async function CfInit() {
	console.log('CfInit')
  // 应用初始化
  await $store("app").init(); 
  // 字典初始化
   await $store("dict").init(); 

   console.log('$store.dict=>',$store('dict').dict)
  // 平台初始化加载(各平台provider提供不同的加载流程)
  $platform.load();

  if (process.env.NODE_ENV === "development") {
    CfDebug();
  }
}

// 开发模式
function CfDebug() {
  // 开发环境引入vconsole调试
  
}

export default cfsheep
